#pragma once

//#include <qobject>
#include <QWidget>
#include <QListWidget>
#include <QListWidgetItem>
#include <QLabel>
//#include <QMouseEvent>
//#include <QPushbutton>
#include "opencv2/opencv.hpp"
#include <deque>

class QThumbnailList :
    public QWidget
{
    Q_OBJECT

public:
    QThumbnailList(QWidget* parent = nullptr);
    ~QThumbnailList();

    void addMatImageItem(cv::Mat& img, std::string str);
    void addMatItem(cv::Mat& item, QString imgPath);
    void addImageItem(QImage &item, QString imgPath);

    void addImageItems(QStringList& files);

    void setIconMaxNums(int nums);

    void ClearAllIcons();

private slots:
    void showFullSizeImage(QListWidgetItem* item);

private:
    QListWidget* listWidget;
    QLabel* label_;

    std::deque<QImage> iconImageList_;
    std::deque<cv::Mat> iconMatList_;

    int maxCount_ = 100;
};

